import { RouteRecordRaw } from 'vue-router';
import { Layout } from '../constant';
import { UsbTwotone } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routeName = 'serial';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/serial',
    name: routeName,
    //redirect: '/serial/index',
    component: Layout,
    meta: {
      title: 'Serial',
      icon: renderIcon(UsbTwotone),
      permissions: ['admin'],
      sort: 22,
    },
    children: [
      {
        path: 'index',
        name: `${routeName}_index`,
        meta: {
          title: '串口配置',
          permissions: ['admin'],
          affix: true,
        },
        component: () => import('@/views/serial/index.vue'),
      },
    ],
  },
];

export default routes;
